<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="TagGroup" prefix="mytag"%>
<%@ page import="dao.*" %>
<!doctype html>
<html lang="zh-CN">

<style>
.excerptqzk{clear:both;border:1px solid #EAEAEA;padding:10px 10px 10px 10px;overflow:hidden;background-color:#fff;margin-bottom:-1px;}
ul{
	display:inline-block !important;
}
.pagination{
	margin-left:20px;
}
</style>
<head >
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>帖子详情</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/show.css">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/nprogress.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="apple-touch-icon-precomposed" href="images/icon.png">
<link rel="shortcut icon" href="images/favicon.ico">
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/nprogress.js"></script>
<script src="js/jquery.lazyload.min.js"></script>
<!--[if gte IE 9]>
  <script src="js/jquery-1.11.1.min.js" type="text/javascript"></script>
  <script src="js/html5shiv.min.js" type="text/javascript"></script>
  <script src="js/respond.min.js" type="text/javascript"></script>
  <script src="js/selectivizr-min.js" type="text/javascript"></script>
<![endif]-->
<!--[if lt IE 9]>
  <script>window.location.href='upgrade-browser.html';</script>
<![endif]-->

</head>
<body class="user-select">
<mytag:userPageHeaderTag/> 

<section class="container">
<div class="content-wrap">
<div class="content">
	<div class="show-wrap">
				<!--这个是显示帖子的标题-->
		<div class="show-title">${showArticle.article.article_title}
			<div class="article-meta" style="align:center;margin:10px auto;"> 
			<span class="item article-meta-time">
			  <time class="time" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="发表时间:${showArticle.article.article_createtime}"><i class="glyphicon glyphicon-time"></i>${showArticle.article.article_createtime}</time>
			  </span> <span class="item article-meta-source" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="来源：木庄网络博客">
			  <i class="glyphicon glyphicon-globe"></i> 木庄网络博客</span>
			  <span class="item article-meta-category" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="MZ-NetBlog主题">
			  <i class="glyphicon glyphicon-list"></i> <a href="#" title="主题：${showArticle.theme.theme_name}" >主题:${showArticle.theme.theme_name}</a></span>
			  <span class="item article-meta-views" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="浏览量：${showArticle.article.article_click_num}">
			  <i class="glyphicon glyphicon-eye-open"></i>${showArticle.article.article_click_num}</span>
			  <span class="item article-meta-comment" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="评论量">
			  <i class="glyphicon glyphicon-comment"></i>${showArticle.article.article_comment_num}</span> 
			 </div>
		</div>
		
		<!--这个是显示帖子的内容的，里面是一层楼一层楼一层楼-->
		<div class="show-content-wrap">
			
			<!--一个row就是一楼-->
			<div class="row show-content" style="width:100%;margin-left:0px;margin-right:0px">
				<div class="show-content-user col-md-2">
						<c:choose>
							<c:when test="${author.user_sex==0}">			
								<c:if test="${user.user_id==author.user_id}">
									<p><a href="My_Home"><img src="images//woman.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>
								<c:if test="${user.user_id!=author.user_id}">
									<p><a href="Ta_Home?id=${author.user_id}"><img src="images//woman.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>		
							</c:when>
							<c:when test="${author.user_sex==1}">
								<c:if test="${user.user_id==author.user_id}">
									<p><a href="My_Home"><img src="images//man.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>
								<c:if test="${user.user_id!=author.user_id}">
									<p><a href="Ta_Home?id=${author.user_id}"><img src="images//man.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>
							</c:when> 
							<c:otherwise>
								
							</c:otherwise>
						</c:choose> 
						<!-- 如果session 有用户的id，用上面那段就ok-->						
					<c:if test="${user.user_id==author.user_id}">
						<p>我</p>
						<a type="button" class="btn btn-link btn-lg" style="font-size: 15px" href="BeforeModityArticleServlet?article_id=${showArticle.article.article_id }">
						  <span class="glyphicon glyphicon-pencil"></span>修改
						</a>
					</c:if>
					<c:if test="${user.user_id!=author.user_id}">
						<p>${author.user_name}</p>
					</c:if>					
				</div>
				<div class=" col-md-10 show-content-right ">
					<div class="show-content-article">${showArticle.content.content}</div>
					<footer class="show-article-footer">						
						<span class="glyphicon glyphicon-thumbs-up"></span> 
						<span style="color:red;font-size:11px" name="zan_num"><b>${showArticle.article.article_zan_num}</b></span>	
						<span style="padding-left:10px">${showArticle.article.article_createtime} </span>
						<span class="pull-right" style="font-size:15px">楼主</span>
					</footer>
				</div>				
			</div>

			<c:forEach items="${pageBean.list}" var="comment" varStatus="sta">
				<div class="row  show-content" style="width:100%;margin-left:0px;margin-right:0px">
					<div class="show-content-user col-md-2">
					<c:choose>
							<c:when test="${UserDAO.getInstance().get(comment.user_id).user_sex==0}">
								<c:if test="${user.user_id==comment.user_id}">
									<p><a href="My_Home"><img src="images//woman.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>
								<c:if test="${user.user_id!=comment.user_id}">
									<p><a href="Ta_Home?id=${comment.user_id}"><img src="images//woman.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>	
							</c:when>
							<c:when test="${UserDAO.getInstance().get(comment.user_id).user_sex==1}">
								<c:if test="${user.user_id==comment.user_id}">
									<p><a href="My_Home"><img src="images//man.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>
								<c:if test="${user.user_id!=comment.user_id}">
									<p><a href="Ta_Home?id=${comment.user_id}"><img src="images//man.jpg" class="img-circle" style="width:60px;height:60px" /></a></p>
								</c:if>	
							</c:when> 
						</c:choose>  
						<!-- 如果session 有用户的id，用上面那段就ok-->	
						<c:if test="${user.user_id==comment.user_id}">
								<p>我</p>
						</c:if>
						<c:if test="${user.user_id!=comment.user_id}">
							<p>${comment.user_name}</p>
						</c:if>					
					</div>
					<div class=" col-md-10 show-content-right ">
						<div class="show-content-article">
							<p>${comment.comment_content}</p>
						</div>
						<footer class="show-article-footer">						
							<span class="glyphicon glyphicon-thumbs-up"></span> 
							<span style="color:red;font-size:11px" name="zan_num"><b>${comment.comment_zan_num}</b></span>	
							<span style="padding-left:10px">${comment.comment_time}</span>
							<span class="pull-right" style="font-size:15px"># ${sta.count}</span>
						</footer>
					</div>
				</div>
			</c:forEach>
			<div class="show-content-footer">
			<c:if test ="${pageBean.totalPage>1}">			
					<ul class="pagination" style="display:inline-block;">
						<li style="padding-top:10px;margin-left:10px;width:20px;height:20px;vertical-align:middle;text-align:center">
						<select onchange="window.location=this.value;">
							<c:forEach var="i" begin="1" end="${pageBean.totalPage}">
								<option value ="ShowTieServlet?pageNum=${i}">${i}</option>
							</c:forEach>
					</select>Page</li>
			</c:if>
			
			<c:choose>
				<c:when test="${pageBean.totalPage>1&& pageBean.pageNum==1}">
						<li><a href="ShowTieServlet?pageNum=1">首页</a></li>
						<li><a class="disabled" >上一页</a></li>
						<li><a href="ShowTieServlet?pageNum=${pageBean.end}">下一页</a></li>
						<li><a href="ShowTieServlet?pageNum=${pageBean.totalPage}">尾页</a></li>
				</c:when>
				<c:when test="${pageBean.totalPage>1&&pageBean.pageNum==pageBean.totalPage}">
						<li><a href="ShowTieServlet?pageNum=1">首页</a></li>
						<li><a href="ShowTieServlet?pageNum=${pageBean.start}" >上一页</a></li>
						<li><a class="disabled">下一页</a></li>
						<li><a href="ShowTieServlet?pageNum=${pageBean.totalPage}">尾页</a></li>
				</c:when>
				<c:when test="${pageBean.totalPage>1}">
						<li><a href="ShowTieServlet?pageNum=1">首页</a></li>
						<li><a href="ShowTieServlet?pageNum=${pageBean.start}" >上一页</a></li>
						<li><a href="ShowTieServlet?pageNum=${pageBean.end}">下一页</a></li>
						<li><a href="ShowTieServlet?pageNum=${pageBean.totalPage}">尾页</a></li>
				</c:when>
			</c:choose>
			<c:if test ="${pageBean.totalPage>1}">
				</ul>
				<span>共${pageBean.totalPage}页</span>
			</c:if>
			</div>
		</div>

		
	</div>
	<!-- show-wrap -->
	<div class="editor-wrap">
		<div class="editor">
			<h4 style="margin-left:58px;margin-bottom:5px;margin-bottom:20px">发表回复</h4>
			<form action="AddCommentServlet?article_id=${showArticle.article.article_id}" method="POST">
				<script id="editor" type="text/plain" style="width:700px;height:300px;margin:0 auto"></script>
				<center><button type="submit" class="btn btn-danger" style="margin:15px auto">发表回复</button></center>
			</form>
		</div>
    </div>
	
</div>
</div>
<div class="tlinks">Collect from <a href="http://www.cssmoban.com/" >企业网站模板</a></div>

</section>
<footer class="footer">
<div class="container">
<p>Copyright &copy; 企业论坛  Powered by YNWA team!</p>
</div>
<div id="gotop"><a class="gotop"></a></div>
</footer>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.ias.js"></script>
<script src="js/scripts.js"></script>
<script type="text/javascript" charset="utf-8" src="utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="utf8-jsp/ueditor.all.min.js"> </script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor',{
		toolbars:[['simpleupload','insertvideo','scrawl','emotion']
		]
		
	
	});
</script>
</body>
</html>
